package cc.mrbird.plan.service.impl;

import cc.mrbird.common.service.impl.BaseService;
import cc.mrbird.plan.domain.InspectionAssetMana;
import cc.mrbird.plan.service.InspectionAssetManaService;
import cc.mrbird.system.domain.UserRole;
import cc.mrbird.system.service.UserRoleService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import java.util.Arrays;
import java.util.List;

@Service("inspectionAssetManaService")
@Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class)
public class InspectionAssetManaServiceImpl extends BaseService<InspectionAssetMana> implements InspectionAssetManaService {
    @Override
    @Transactional
    public void deleteInspectionAssetManasByAssetManaId(String assetManaId) {
        List<String> list = Arrays.asList(assetManaId.split(","));
        this.batchDelete(list, "assetMana_id", InspectionAssetMana.class);
    }

    @Override
    @Transactional
    public void deleteInspectionAssetManasByInspectionId(String inspectionId) {
        List<String> list = Arrays.asList(inspectionId.split(","));
        this.batchDelete(list, "inspection_id", InspectionAssetMana.class);
    }
}
